<?php

class ReviewsController extends Controller
{
	public function actionGetSlogan(){
		$reviews = Reviews::model()->findAllByAttributes(array(
			'type'=>0
		));
		$totalItem = count($reviews) - 1;
		if($totalItem<0) $totalItem = 0;
		$data = array();
		if($totalItem != 0){
			$data = $reviews[rand(0,$totalItem)];
			$data['id'] = outStr($data['id']);
			$data['owner_id'] = outStr($data['owner_id']);
		}
		jsonOut(array(
			'error'=>false,
			'data'=>$data,
		));
	}
	
}